import random
cpu_num = random.randint(1, 3)
player_num = int(input('游戏规则：传统的猜拳游戏，现以1代表石头，2代表剪刀，3代表布。玩家应输入对应的数字代表自己的选择。 \n请做出你的选择：'))
if (player_num == 1 and cpu_num == 3) or (player_num == 2 and cpu_num == 1) or (player_num == 3 and cpu_num == 2):
    print('对方的选择为%d，你输了！' % cpu_num)
elif player_num == cpu_num:
    print('对方的选择为%d，平局！' % cpu_num)
else:
    print('对方的选择为%d，你赢了！' % cpu_num)
